Communication systems use a variety of protocols for data transfers. For example, Internet-based communication systems use protocols such as transport control protocol (TCP), user datagram protocol (UDP), etc., for data transfer. When data is transmitted in packets, data integrity is ensured by employing various error-detecting schemes such as checksums.
In some communication systems, checksums are calculated by network adapters rather than by host devices before packets are transmitted. In some communication systems, however, network adapters may not have sufficient memory to calculate checksums. In that case, host devices calculate checksums, write checksums in packets, and forward the packets with checksums to network adapters for transmission.
Referring now to FIG. 1, a host device 10 stores a packet 12 of data to be transmitted in host memory 14. A network device 16 communicates with the host device 10 via a bus 18. The network device 16 has a network device memory 20.
The network device 16 reads the packet 12 from the host device 10, stores the packet 12 in the network device memory 20, generates a checksum for the packet 12, and transmits the packet 12 with the checksum. A receiving system that receives the packet 12 checks the data in the packet 12 against the checksum and determines whether the data in the packet 12 received is the same as the data in the packet 12 when the packet 12 was transmitted.
Space and cost considerations generally limit the size of the network device memory 20. When a packet size of the packet 12 is greater than a memory size of the network device memory 20, the network device 16 cannot store the packet 12 in the network device memory 20. Consequently, the network device 16 cannot calculate the checksum for the packet 12.
In that case, the host device 10 calculates the checksum for the packet 12 and writes the checksum in the packet 12 while the packet 12 is stored in the host memory 14. The host device 10 forwards the packet 12 with the checksum to the network device 16. The network device 16 transmits the packet 12 with the checksum.